/*
 * @Author: wangc
 * @Date: 2020-08-08 18:50:55
 * @LastEditTime: 2020-08-09 19:17:33
 * @Description: 
 */
import Vue from 'vue'
/**判断当前设备是否为移动端 */
function isMobile() {
    let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
    return flag;
}
Vue.prototype.isMobile = isMobile;
/**
 * 时间戳转换方法    date:时间戳数字
 * @param {*} date 
 * @returns 
 */
export function formatDate(date2) {
    var date = new Date(date2)
    var YY = date.getFullYear() + '-'
    var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
    var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
    var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
    var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
    var ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
    return YY + MM + DD + ' ' + hh + mm + ss
}